package auth;

public class Identity 
{
	/**
	 * The identity of the user. Since only 1 user can enter at a time; it is static.
	 */
	private static User _user;
	
	/**
	 * Get the identity
	 * 
	 * @return User
	 */
	public static User getIdentity()
	{
		return _user;
	}
	
	/**
	 * @return Does the user has an identity? (is he logged in?)
	 */
	public static boolean hasIdentity()
	{
		return _user != null;
	}
	
	/**
	 * Set a new user
	 * 
	 * @param user
	 */
	public static void setIdentity(User user)
	{
		_user = user;
	}
}
